import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/frontHome/index",
  },
  {
    path: "/frontHome",
    name: "FrontHome",
    component: () => import("../page/FrontHome.vue"),
    children: [
      {
        path: "index",
        name: "Index",
        component: () => import("../page/Index.vue"),
      },
      {
        path: "lncrease",
        name: "Increase",
        component: () => import("../page/Increase.vue"),
      },
      {
        path: "mine",
        name: "Mine",
        component: () => import("../page/Mine.vue"),
      },
    ]
  },
  {
    path: "/shop",
    name: "Shop",
    component: () => import("../page/Shop.vue"),
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("../page/Login.vue"),
  },
  {
    path: "/register",
    name: "Register",
    component: () => import("../page/Register.vue"),
  },
  {
    path: "/shopChe",
    name: "ShopChe",
    component: () => import("../page/ShopChe.vue"),
  },
  {
    path: "/keFu",
    name: "KeFu",
    component: () => import("../page/KeFu.vue"),
  },
  {
    path: "/order",
    name: "Order",
    component: () => import("../page/Order.vue"),
  },
  {
    path: "/account",
    name: "Account",
    component: () => import("../page/Account.vue"),
  }
];

const router = new VueRouter({
  mode: "history",
  routes,
});

export default router;